<{include file="Public/top.html" }>
</head>
<body>
<div id="warpper">
    <div class="content">
        <div class="location">商户管理</div>
        <{include file="Restaurant/nav.html"}>
        <a class="return" href="<{u('verificationList')}>">&lt;  返回</a>
        <div class="topic">添加核销员信息</div>
        <div class="form-box border0 border-box">
            <form action="<{u('verificationEdit')}>" class="ui-form" id="addManagerForm" method="post">
                <input type="hidden" id="id" name="id" value="<{$item.id}>">
                <div class="ui-form-item">
                    <label class="ui-label">所属商家：</label>
                    <label class="ui-label" style="text-align:left;"><{$restaurantName}></label>
                </div>
                <div class="ui-form-item">
                    <label class="ui-label">所属门店：</label>
                    <label class="ui-label" style="text-align:left;"><{$storeName}></label>
                </div>
                <div class="ui-form-item">
                    <label class="ui-label">核销工号：</label>
                    <label class="ui-label" style="text-align:left;"><{$item.jobNum}></label>
                </div>
                <div class="ui-form-item">
                    <label class="ui-label">核销员姓名：</label>
                    <input type="text" class="ui-text" name="verificationName" value="<{$item.verificationName}>" required/>
                </div>
                <div class="ui-form-item">
                    <label class="ui-label">手机号：</label>
                    <input type="text" class="ui-text" value="<{$item.phone}>" name="phone" id="phone" required/>
                    <span class="verification-msg" id="phoneMsg">(用于登陆)</span>
                </div>
                <div class="ui-form-item">
                    <label class="ui-label">登陆密码：</label>
                    <input type="text" class="ui-text"  name="password" required />
                    <span class="verification-msg">(留空则不修改)</span>
                </div>


                <div class="integral_btn-group">
                    <input type="submit" value="提交" class="ui-button"/>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
<script>
    var oldPhone="<{$item.phone}>";
    $('#phone').on('blur',function(){
        var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
        var phone = $("#phone").val();
        if(!myreg.test(phone)){
            $('#phoneMsg').text('请输入正确的手机号码');
            return;
        }
        if(oldPhone==phone){
            $('#phoneMsg').text('手机号码未修改');
            return;
        }
        var id=$('#id').val()
        $.post("<{U('verificationEdit')}>","phone="+phone,function(re){
            if(re.status!=0){
                $('#phoneMsg').text(re.msg);
            }else{
                $('#phoneMsg').text("号码正确");
            }
        },'json');
    });
</script>
<{include file="Public/foot.html" }>